var Zhenbie = new Vue({

    el : '#ZhenbieDetail',
    data :{
        deptId :  $("#deptid").val(),
        jiashuid :  $("#jiashuid").val(),
        jingshangid:'',

        zhengbie:{},
        zhenbieList : [],


        editFlag : 0,					// 0:新增，1：修改
        show : false,					// 显示列表是否有数据


        pageIndex : 1,
        pageSize :6,
        pageCount : 0,
        recordCount : 0,
        inputPageIndexValue : "",

    },
    created : function() {

        this.findZhenbieByJiashuId();

    },
    methods : {

        findZhenbieByJiashuId: function(){
            var _this = this;
            layer.open({type:3});
            $.post("../zhenbieqingkuang/find_by_jiashuid",{
                jiashuid : _this.jiashuid,
                rdm : Math.random()
            },function(ppData){
                layer.closeAll("loading");
                if (ppData != null){
                    if(ppData.result == "1"){
                        var data=ppData.resultContent;

                        if(data.length > 0){
                            _this.zhenbieList=data;
                        }

                    }else{
                        layer.alert(ppData.message);
                    }
                }

            },"json");
        },



        toclose: function(){
            xadmin.close();
        },

        //跳到首页
        SetPageIndex : function(){
            this.pageIndex = 1;
        },
        SetPageEnd : function(){
            this.pageIndex = this.pageCount;
        },
        //上一页
        SetPageIndexPrePage : function(){
            var PrePage = ((this.pageIndex -1) <= 0) ? 1 : (this.pageIndex -1);
            this.pageIndex = PrePage;
        },
        //下一页
        SetPageIndexNextPage : function(){
            var NextPage = ((this.pageIndex +1) >= this.pageCount) ? this.pageCount : (this.pageIndex +1);
            this.pageIndex = NextPage;
        },
        //跳转界面
        JumpPage : function(){
            if(this.inputPageIndexValue <= 1){
                this.inputPageIndexValue = 1;
            }else if(this.inputPageIndexValue >= this.pageCount){
                this.inputPageIndexValue = this.pageCount;
            }
            this.pageIndex = this.inputPageIndexValue;
            this.inputPageIndexValue = '';
        },

    },
    watch :{

    }

});
